#include "stdafx.h"
#include "MLP.h"
#include "layer.h"
#include "neuron.h"
#include "hidden_neuron.h"

namespace nnse
{
	extern io_module io_m;

	// Constructor and Destructor

	template <class T, class U> hidden_neuron<T, U>::hidden_neuron(layer<T, U>^ p, unsigned int n_n)
	: neuron<T, U>(p, n_n)
	{
		io_m.startup_stream << "Constructing hidden neuron " << get_number() << std::endl;
		layer<T, U>% previous_layer=get_parent_MLP()->get_layer(get_parent_layer()->get_number()-1);
		put_number_of_dendrites(previous_layer.get_number_of_neurons());
		put_dendrites();
	}

	template <class T, class U> hidden_neuron<T, U>::~hidden_neuron()
	{
		io_m.startup_stream << "Destructing hidden neuron " << get_number() << std::endl;
	}

	// Serialisation Functions

	template <class T, class U> void hidden_neuron<T, U>::display(std::wofstream& out)
	{
		out << "Hidden Neuron:" << std::endl;
		neuron<T, U>::display(out);
	}

	// Explicit Instantiation

	template ref class hidden_neuron<bool, double>;
	template ref class hidden_neuron<unsigned char, double>;
}
